<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <button @click="index = index == 0 ? 7 : index-1 ">上一页</button>
      <button @click="index = index == 7 ? 0 : index+1 ">下一页</button>
      <img v-bind:src="list[index]" alt="" />
    </div>

    <script src="../../../vue.js"></script>

    <script>
      const vue = new Vue({
        el: "#app",
        data: {
          list: [
            "./imgs/01.png",
            "./imgs/02.png",
            "./imgs/03.gif",
            "./imgs/04.gif",
            "./imgs/05.gif",
            "./imgs/06.gif",
            "./imgs/07.png",
            "./imgs/08.png",
          ],
          index: 0,
        },
      });
    </script>
  </body>
</html>
